﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using System.Threading.Tasks;

namespace NineMine.DataModel
{
    public class Issue
    {
        [Key]
        public long Id { get; set; }

        [Required]
        public Tracker Tracker { get; set; }

        [Required]
        public Project Project { get; set; }

        [MaxLength(255)]
        [Required]
        public string Subject { get; set; }

        [Column(TypeName = "ntext")]
        public string Description { get; set; }

        public DateTime? DueDate { get; set; }

        public IssueCategory Category { get; set; }

        [Required]
        public IssueStatus Status { get; set; }

        public User AssignedTo { get; set; }

        [Required]
        public Enumeration Priority { get; set; }

        public Version FixedVersion { get; set; }

        [Required]
        public User Author { get; set; }

        public long LockVersion { get; set; }

        public DateTime? CreatedOn { get; set; }

        public DateTime? UpdatedOn { get; set; }

        public DateTime? StartDate { get; set; }

        public long DoneRatio { get; set; }

        public decimal EstimatedHours { get; set; }
        
        public Issue Parent { get; set; }

        public long RootId { get; set; }

        public long lft { get; set; }

        public long rgt { get; set; }

        public bool IsPrivate { get; set; }

        public DateTime? ClosedOn { get; set; }

        public List<TimeEntry> TimeEntries { get; set; }
    }
}
